package com.home.entity.sensor;


import com.home.entity.environment.Environment;
import com.home.subject.Subject;

public class TempSensor implements Sensor {
    private float temp;
    private Subject subject;
    private TempSensor() {

    }

    public TempSensor(Subject subject) {
        this.subject = subject;
        subject.registerSensor(this);
    }

    public float getTemp() {
        return temp;
    }

    public void setTemp(float temp) {
        this.temp = temp;
    }

    @Override
    public void update(Environment environment) {
        setTemp(environment.getTemp());
    }
}
